import os
import xlrd
import gzip
import numpy as np

def read_excle(filename):
	file = xlrd.open_workbook(filename)
	table = file.sheets()[0]
	a0 = [ cell.value for cell in table.col(0)]
	a1 = [ cell.value for cell in table.col(1)]
	a2 = [ cell.value for cell in table.col(2)]
	a3 = [ cell.value for cell in table.col(3)]
	a4 = [ cell.value for cell in table.col(4)]
	a5 = [ cell.value for cell in table.col(5)]
	a6 = [ cell.value for cell in table.col(6)]
	a7 = [ cell.value for cell in table.col(7)]
	a8 = [ cell.value for cell in table.col(8)]
	a9 = [ cell.value for cell in table.col(9)]
	a10 = [ cell.value for cell in table.col(10)]
	a11 = [ cell.value for cell in table.col(11)]
	a12 = [ cell.value for cell in table.col(12)]
	a13 = [ cell.value for cell in table.col(13)]
	a14 = [ cell.value for cell in table.col(14)]
	a15 = [ cell.value for cell in table.col(15)]
	a16 = [ cell.value for cell in table.col(16)]
	a17 = [ cell.value for cell in table.col(17)]
	a18 = [ cell.value for cell in table.col(18)]
	a19 = [ cell.value for cell in table.col(19)]
	a20 = [ cell.value for cell in table.col(20)]
	y = [ cell.value for cell in table.col(21)]
	data = list(zip(a0[1:], a1[1:], a2[1:], a3[1:], a4[1:], a5[1:], a6[1:], \
		a7[1:], a8[1:], a9[1:], a10[1:], a11[1:], a12[1:], a13[1:], a14[1:], a15[1:], a16[1:], \
		a17[1:], a18[1:], a19[1:], a20[1:], y[1:]))
	n_samples = len(data)
	data = np.asarray(data, dtype=np.float32)
	return data, n_samples
if __name__ == '__main__':
	data, n_samples = read_excle('data.xlsx')
	print(n_samples)